package cn.tannn.surenessdemo.user.entity;

import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * resource-role mapping entity
 * @author tan
 * @date 2022-07-18 10:37:39
 */
@Entity
@Table(name = "auth_role_resource_bind",indexes = {
        @Index(name = "role_resource_inde",columnList = "roleCode,resourceCode",unique = true)
})
@org.hibernate.annotations.Table(appliesTo = "auth_role_resource_bind", comment = "角色资源关系表")
@Getter
@Setter
@ToString
@Builder
@AllArgsConstructor
@NoArgsConstructor
@DynamicUpdate
@DynamicInsert
public class AuthRoleResourceBind extends CommonBean<AuthRoleResourceBind> {

    @Column(columnDefinition="varchar(50) not null COMMENT '角色Code'")
    private String roleCode;

    @Column(columnDefinition="varchar(50) not null  COMMENT '资源Code'")
    private String resourceCode;

}
